import { $post, $put, $get,$delete } from '@/until/http'; // 导入http中创建的axios实例
//import qs from 'qs'; // 根据需求是否导入qs模块 qs.stringify(params)

const mine = {    
    // 获取用户信息   
    getUserInfo (params) {        
        return $get('/api/user/getUserInfo',params);  
    },
    // 更新用户信息   
    updateUserInfo (params) {        
        return $put('/api/user/update',params);  
    },
    // 获取商城优惠券   
    getMyCoupon (params) {        
        return $get('/api/coupons',params);  
    },
    // 获取用户积分流水   
    getIntegralRecords (params) {        
        return $get('/api/integrals/records',params);  
    },
    // 获取商城活动   
    getActivitys (params) {        
        return $get('/api/activitys/enableActivitys',params);  
    },
    // 获取兑换优惠券   
    exchangeCoupon (params) {        
        return $post(`/api/coupons/coupon`,params);  
    },
    // 活动赠送积分   
    getActivitysCoupon (params) {        
        return $post(`/api/activitys/${params}`);  
    },
    // 账单积分申请 
    applyIntegral (params) {        
        return $post(`/api/integrals/apply`,params);  
    },
    // 上传图片   
    uploadImages (params) {        
        return $post(`/api/common/uploadImages`,params,'file');  
    },
    // 获取用户积分流水   
    getApplysIntegralsList (params) {        
        return $get('/api/integrals/applys',params);  
    },
    // 获取微信用户信息   
    getWeiXinUserInfo (params) {        
        return $get('/api/user/getWeiXinUserInfo',params);  
    },
    // 获取店铺微信用户信息   
    getComWeiXinInfo (params) {        
        return $get('/api/companyUser/getWeiXinUserInfo',params);  
    },
    // 获取店铺优惠券   
    getMyShopCoupons (params) {        
        return $get('/api/shopCoupons/myShopCoupons',params);  
    },
    // 获取店家账单   
    getShopBill (params) {        
        return $get('/api/companyBill',params);  
    },
    // 获取店家账单明细  
    getShopBillDetail (params) {        
        return $get('/api/companyBill/companybill',params);  
    },
    // 获取用户关注的店家  
    getUserAttentionShops (params) {        
        return $post('/api/user/getUserAttentionShops',params);  
    },
    // 关注店家  
    attentionShop (params) {        
        return $post(`/api/user/attentionShops/${params}`);   
    },
    // 取消关注店家  
    cancelAttentionShop (shopId) {        
        return $delete(`/api/user/attentionShops/${shopId}`);  
    },
    // 修改密码  
    modifyUserPassword (params) {        
        return $put('/api/user/modifyUserPassword',params);  
    },
    // 所有店家列表 
    getShopUserList (params) {        
        return $post('/api/companyUser/GetShopUserList',params);  
    },
    // 获取店家详情(用户登录后)
    getCompanyUserInfo () {        
        return $get('/api/companyUser/getCompanyUserInfo');  
    },
    // 获取店家详情(列表进详情)
    getShopInfo (params) {        
        return $get('/api/companyUser/GetShopInfo',params);  
    },
    // 获取店家活动列表 
    getShopActivetysList (shopId) {        
        return $get(`/api/shopActivity/${shopId}/enableActivitys`);  
    },
    // 参与店家活动 
    shopActivity (shopActivityId) {        
        return $post(`/api/shopActivity/${shopActivityId}`);  
    },
    // 获取店铺类型
    getAllShopTypes () {        
        return $get(`/api/companyUser/allShopTypes`);  
    },
    // 修改店家密码
    updateShopPassword (params) {        
        return $put(`/api/companyUser/pwd`,params);  
    },
    // 修改店家信息
    updateCompanyUser (params) {        
        return $put(`/api/companyUser/UpdateShopInfo`,params);  
    },
    // 修改系统配置信息
    getConfigType (configType) {   
        return $get(`/api/systems/${configType}`);  
    },
    // 参加活动
    joinActivity (params) {   
        return $get(`/api/activitys/JoinActivity`,params);  
    },
}

export default mine;